Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

392
Visualizações
GLSL File: "Module parse failed: Unexpected token"

I am building image transition with a custom shader and for this i need a fragment.glsl. But when importing this file into my .js, this error shows up:

Compiled with problems:

ERROR in ./src/shaders/fragment.glsl 1:13

Module parse failed: Unexpected token (1:13)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> void main () {
| 
| }

For a fast start i am using this webpack boilerplate: https://github.com/taniarascia/webpack-boilerplate

Because of my not existing experience in webpack and glsl files i dont know whats wrong. I am assuming, that the browser is not able to read the file. I tried a lot of stuff with webpack.config.js and modules like glfl-loader but looks like my browser got other plans.

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

After testing around i found the solution:

i had to edit this to the webpack.config.js

// Shader

{ test: /\.(glsl|vs|fs|vert|frag)$/,  type: 'asset/source',generator: { filename: 'assets/images/[hash][ext]' }}
about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda